﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Wicresoft.RSS.Engine;
using Wicresoft.Framework.Organization;
using Wicresoft.Common;
public partial class Rss_CarRssInfoList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();
        RSSObj obj = new RSSObj();
        obj.Title = "待审核的车辆申请";
        obj.Link = ConfigurationManager.AppSettings["ApplicationServer"] + this.Request.ApplicationPath + "/Car/VehicleApplyApprove.aspx";

        if (!string.IsNullOrEmpty(Request.QueryString["user"]))
        {
            User user = OrganizationPublicHelper.GetUserInfo(Request.QueryString["user"]);
           // string DepartmentId = user.GetMainDepartment().ID.ToString();
            int recordCount = 0;

            DataTable dt = DataAccess.Select(typeof(Wicresoft.JDPostBoard.Entity.VehicleApply2), 0, 50, "Status='0' ", "ApplyDate DESC", ref recordCount);

            foreach (DataRow dr in dt.Rows)
            {
                RSSItem item = new RSSItem();
                item.Title = "事由：" + dr[Wicresoft.JDPostBoard.Entity.VehicleApply2.SQLCOL_PURPOSE].ToString()+",目的地：" + dr[Wicresoft.JDPostBoard.Entity.VehicleApply2.SQLCOL_DESTINATION].ToString();
                item.Link = ConfigurationManager.AppSettings["ApplicationServer"] + this.Request.ApplicationPath + "/Car/VehicleApplyView.aspx?UserType=View&ID=" + dr[Wicresoft.JDPostBoard.Entity.VehicleApply2.SQLCOL_ID].ToString();
                item.PubDate = DateTime.Parse(dr[Wicresoft.JDPostBoard.Entity.VehicleApply2.SQLCOL_APPLYDATE].ToString());
                item.IsRead = 0;
                obj.Items.Add(item);
            }
        }
        Response.Write(obj.XML.OuterXml);
        Response.End();
    }
}